package com.graduation.roombooking.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.graduation.roombooking.dto.AppletTimeListDTO;
import com.graduation.roombooking.dto.OrderListDTO;
import com.graduation.roombooking.dto.PersonalOrderDTO;
import com.graduation.roombooking.dto.StatisticsDTO;
import com.graduation.roombooking.pojo.Order;
import com.graduation.roombooking.vo.PersonalOrderVo;
import com.graduation.roombooking.vo.UnionQueryOrderVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author ZhaoXinyi
 * @since 2022-05-04
 */
@Mapper
public interface OrderMapper extends BaseMapper<Order> {

    List<OrderListDTO> getList(String companyName);

    int getStatusById(String orderId);

    int updateStatus(@Param("companyName") String companyName, @Param("status") Integer status, @Param("orderId") String orderId);

    List<OrderListDTO> unionQuery(@Param("vo") UnionQueryOrderVo unionQueryOrderVo, @Param("companyName") String companyName);

    //预约功能
    int appoint(Order order);

    List<Order> getOrderByOpenDateAndTime(@Param("day") Date day,@Param("time") String time);

    //获取七天内的数据
    List<AppletTimeListDTO> getTimeList();

    int cancelOrder(Integer orderId);

    List<PersonalOrderDTO> getPersonalOrder(@Param("vo") PersonalOrderVo personalOrderVo, @Param("phone") Long phone);

    List<StatisticsDTO> getStatistics(@Param("companyName") String companyName,@Param("day") Integer day);

    Order getInfoById(Integer orderId);

    Integer scheduleTask();
}
